package tool.workflow.soft

import java.io.File

import command.CommandExec
import implicits.Implicits._
import shared.Pojo._
import shared.SharedTool
import tool.Pojo._
import tool.Tool
import tool.workflow.soft.AllSubSoft.SubSoftBT
import utils.Utils
import com.softwaremill.quicklens._

/**
 * Created by yz on 30/10/2020
 */
object Normal extends SubSoftBT with NormalSoftT {
  override def exec(workspaceDir: File, resultDir: File, si: String): CommandExec[Any, Boolean] = {
    CommandExec().exec { b =>
      getCommandData(workspaceDir, resultDir, si)
    }
  }

  override def getCommand(si: String): String = {
    s"""
       |${"Rscript".condaPath()} ${Tool.rPath.unixPath}/workflow_normal.R --si "${si}"
                       """.stripMargin
  }

  override def getCommandData(workspaceDir: File, resultDir: File, si: String): CommandData = {
    val command =getCommand(si)
    CommandData(workspaceDir, List(command))
  }

}
